<?php


/**
 * security
 * @var int
 */
defined('AGIS') or define('AGIS', 1);

defined('START_TIME') or define('START_TIME', microtime(1));

defined('START_MEM') or define('START_MEM', memory_get_usage());

date_default_timezone_set('UTC');

defined('ROOT_PATH') or define('ROOT_PATH', realpath(dirname(dirname(__FILE__))));

defined('APP_PATH') or define('APP_PATH', ROOT_PATH . '/application');

defined('MODULE_PATH') or define('MODULE_PATH', ROOT_PATH . '/application/module');

defined('LIBRARY_PATH') or define('LIBRARY_PATH', ROOT_PATH . '/library');

defined('TEMP_PATH') or define('TEMP_PATH', ROOT_PATH . '/temporary');

defined('SETTING_PATH') or define('SETTING_PATH', ROOT_PATH . '/application/setting');

defined('STATS_REQUEST') or define('STATS_REQUEST', 'On');

defined('STAGE') or define('STAGE', 'production');

defined('BASE_URL') or define('BASE_URL', '/nuo2/');

defined('BASE_HREF') or define('BASE_HREF', 'http://namnv.younetco.com/nuo2/');

defined('STATIC_VERSION') or define('STATIC_VERSION', 100);

defined('TEMP_PATH') or define('TEMP_PATH', ROOT_PATH . '/temporary');

defined('LOG_PATH') or define('LOG_PATH', ROOT_PATH . '/temporary/log');

defined('SESSION_PATH') or define('SESSION_PATH', ROOT_PATH . '/temporary/session');

defined('CACHE_PATH') or define('CACHE_PATH', ROOT_PATH . '/temporary/cache');
/**
 * set include paths
 */
set_include_path(implode(PATH_SEPARATOR, array(
        MODULE_PATH,
        LIBRARY_PATH,
        get_include_path()
)));

require_once 'Agis/agis.php';
require_once 'Agis/view.php';
require_once 'Agis/controller.php';
require_once 'Agis/request.php';
require_once 'Agis/response.php';
require_once 'Agis/log/writer/file.php';

if (!function_exists('inflect'))
{
    /**
     * @param string $string
     * @return string
     */
    function inflect($string)
    {
        return str_replace(' ', '', ucwords(str_replace(array(
            '.',
            '-'
        ), ' ', $string)));
    }

}

if (!function_exists('deflect'))
{
    /**
     * @param string $string
     * @return string
     */
    function deflect($string)
    {
        return strtolower(trim(preg_replace('/([a-z0-9])([A-Z])/', '\1-\2', $string), '-. '));
    }

}

Agis::bootstrap();
